<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
  <head>
    <title>微信流程管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8" />

    <!-- Bootstrap -->
    <link href="${pageContext.request.contextPath}/wxflow/res1/assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/wxflow/res1/assets/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/wxflow/res1/assets/css/vendor/bootstrap-checkbox.css">

    <link href="${pageContext.request.contextPath}/wxflow/res1/assets/css/minimal.css" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="${pageContext.request.contextPath}/wxflow/res1/assets/js/html5shiv.js"></script>
      <script src="${pageContext.request.contextPath}/wxflow/res1/assets/js/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="bg-1">
 

    <!-- Wrap all page content here -->
    <div id="wrap">
      <!-- Make page fluid -->
      <div class="row">
        <!-- Page content -->
        <div id="content" class="col-md-12 full-page login">


          <div class="inside-block">
            <img src="${pageContext.request.contextPath}/wxflow/res1/assets/images/logo-big.png" alt class="logo">
            <h1><strong>微信</strong>流程管理</h1>
            <h5> bobolnear[AT]163.com</h5>

            <form id="form-signin" class="form-signin">
              <section>
                <div class="input-group">
                  <input type="text" class="form-control" name="userName" id="userName" placeholder="用户名">
                  <div class="input-group-addon"><i class="fa fa-user"></i></div>
                </div>
                <div class="input-group">
                  <input type="password" class="form-control" name="userPw" id="userPw" placeholder="密码">
                  <div class="input-group-addon"><i class="fa fa-key"></i></div>
                </div>
              </section>
              </form>
              <section class="log-in">
                <button class="btn btn-greensea" id="btn_login">登陆</button>
              </section>
            
          </div>


        </div>
        <!-- /Page content -->  
      </div>
    </div>
    <!-- Wrap all page content end -->
  </body>
  
  
<script src="${pageContext.request.contextPath}/wxflow/res1/assets/js/jquery.js"></script>
  <script type="text/javascript">
		function fn_login() {
			var data = new Object();
			data['name'] = $("#userName").val();
			data['pwd'] = $("#userPw").val();
			$.ajax({
						url : "${pageContext.request.contextPath}/admin/login.do", 
						async : true,
						dataType : 'json',
						type : 'POST',
						data : data,
						success : function(data, textStatus) {
							if (data.result == "success") {
								window.location.href = "${pageContext.request.contextPath}/wxflow/index.jsp";
							} else {
								alert("账户验证错误，请重试!");
							}
						},
						error : function(jqXHR, textStatus, errorThrown) {
						}

					});
			//window.location.href = "index.html";

		}
		$(document).ready(function() {
			$("#btn_login").bind("click", fn_login);

		});
	</script>
</html>